﻿using System;
using System.Collections.Generic;
using System.Text;

using Pixysoft.Framework.XSchEmA.Entity;

namespace Pixysoft.Framework.XSchEmA.Checker
{
    class TableChecker
    {
        private static TableChecker instance;
        public static TableChecker Instance
        {
            get
            {
                lock (typeof(TableChecker))
                {
                    if (instance == null)
                        instance = new TableChecker();
                    return instance;
                }
            }
        }

        public bool CheckEmptyTable(DatabaseSchema database)
        {
            foreach (TableSchema table in database.Tables)
                if (table.Columns.Count == 0)
                    throw new Exception();//throw new Exception(table.TableName);

            return true;
        }
    }
}
